|
|
|
|
|
|
|
Of course, as your applications become more complex, you'll need to add code to the application. Before building complex applications, however, you should have a good understanding of the tools available for you to use. |
|
|
|
|
|
|
|
|
When database access was originally added to the Visual Basic product, it came in the form of the Data Control and Access Objects. This allowed the programmer to access any type of database needed by the application. However, it worked best with Access-Jet engine databases that existed on the local PC. As the use of PCs grew in the workplace, larger, more company-wide applications were required to use databases such as Microsoft SQL Server and Oracle. |
|
|
|
|
|
|
|
|
Accessing these larger, enterprisewide databases required a more robust control. Visual Basic 5 not only included the original Data Access Objects but also had a new Remote Data Control and Objects, which were specially designed to access Remote databases using an ODBC connection. However, having two separate types of access also created design issues and generated questions on which type should be used when. Once again, with the release of Visual Basic 6, Microsoft has answered this problem by adding a third data access method to the product that combines the best parts of both of its predecessors. ActiveX Data Objects and its related control provide database access to both local and remote databases without the need to choose the appropriate data access control or object. Instead of discussing the Data Access or Remote Data Controls, the remaining sections will discuss how to use the new ActiveX Data Control and ActiveX Data Objects in a Visual Basic application. |
|
|
|
|
|
|
|
|
Note It is up to you to decide whether to use the older Data Access Control and Objects or the newer ActiveX Data Control and Objects. The size and scope of the application will usually help you to decide which to use. |
|
|
|
|
|
|
|
|
|
The Data control is the main support to a very sophisticated access method that you can easily use to access data in your application database. By setting only a few parameters of the Data control, you can attach to the database and access data from a SQL query without having to write any code at all. The ActiveX Data Control can access any database type required, either directly, for Jet supported databases', or remotely using an OLE DB supported access method. In addition to this flexibility, program code can be |
|
|
|
|
|